from alg import Solution
import time


def run_test_case(numArrows, aliceArrows):
    sol = Solution()
    start_time = time.time()
    result = sol.maximumBobPoints(numArrows, aliceArrows)
    end_time = time.time()

    print(f"\nInput:")
    print(f"numArrows: {numArrows}")
    print(f"aliceArrows: {aliceArrows}")
    print(f"\nOutput:")
    print(f"bobArrows: {result}")
    print(f"Total arrows used: {sum(result)}")
    print(f"Score: {sum(i for i in range(12) if result[i] > aliceArrows[i])}")
    print(f"Execution time: {(end_time - start_time) * 1000:.2f} ms")
    return result


if __name__ == "__main__":
    # Example test cases
    test_cases = [
        (9, [1, 1, 0, 1, 0, 0, 2, 1, 0, 1, 2, 0]),
        (3, [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
        (100000, [10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000]),
    ]

    for i, (numArrows, aliceArrows) in enumerate(test_cases):
        print(f"\n{'=' * 30}")
        print(f"Running Test Case {i + 1}")
        print(f"{'=' * 30}")
        run_test_case(numArrows, aliceArrows)

    # You can also use the generator from gen.py
    from gen import generate_multiple_test_cases

    random_test_cases = generate_multiple_test_cases(2)
    for i, (numArrows, aliceArrows) in enumerate(random_test_cases):
        print(f"\n{'=' * 30}")
        print(f"Running Random Test Case {i + 1}")
        print(f"{'=' * 30}")
        run_test_case(numArrows, aliceArrows)